<?php
namespace Orm\User;

class UserModel extends \Base\BaseOrmModel{

    function __construct()
    {
        parent::__construct();
        $this->table = 't_user';
    }
    public function loadByOpenId($openid)
    {
        $result = $this->fetchOne('*', "`openid`='{$openid}' AND `is_del` = 0");
        if ($result) {
            return $result;
        }
        throw new \Base\Exception\NoRecordException("No record find by id [{$openid}]");
    }
}